package stockblaster.client.objectives;

import stockblaster.client.CurrentUser;

public class MoneyObjective extends Objective {

	/**
	 * Creates an objective with a given description and target cash amount.
	 * 
	 * @param description
	 *            The English description of the objective.
	 * @param money
	 *            The amount of money that must be on hand to complete the
	 *            objective.
	 */
	public MoneyObjective(String description, int sensitivity, int money) {
		super(description, sensitivity);
		this.money = money;
	}

	/**
	 * Check whether the player has more than the target amount of cash.
	 * 
	 * @return Whether or not the player has at least the target amount of cash.
	 */
	public boolean check() {
		return (Math.round(CurrentUser.getFund()) >= money);
	}
	
	/**
	 * 
	 * @return the money goal to achieve
	 */
	@Override
	public Integer getMoneyGoal() {
		return money;
	}

	private int money;
}
